//
//  UserDelegateController.m
//  HMPersonalDoctor
//
//  Created by manman on 16/9/10.
//  Copyright © 2016年 geduo. All rights reserved.
//

#import "UserDelegateController.h"

@interface UserDelegateController ()<UIWebViewDelegate>
//属性WebView
@property(weak,nonatomic)UIWebView *webView;

@end

@implementation UserDelegateController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
      self.navigationItem.title = @"用户协议";
    UIBarButtonItem *btn = [[UIBarButtonItem alloc]initWithTitle:@"返回" style: UIBarButtonItemStyleDone target:self action:@selector(btnClick:)];
   
    self.navigationItem.leftBarButtonItem = btn;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
  
}

- (void)setupUI
{
    //创建一个webView
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width ,[UIScreen mainScreen].bounds.size.height)];
//  设置代理
    self.webView.delegate =self;
//  webView自动进行适配
    webView.scalesPageToFit = YES;
//URL
    NSURL *URL = [NSURL URLWithString:@"http://www.carelink.cn/"];
// 创建并发送请求
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL cachePolicy:0 timeoutInterval:10];
    [request setValue:@"iPhone AppleWebKit" forHTTPHeaderField:@"User-Agent"];
// 加载数据
    [webView loadRequest:request];
//  把webView添加到视图上
    [self.view addSubview:webView];
    
}
- (void)btnClick:(UINavigationItem *)btn
{
    [self.navigationController popViewControllerAnimated:YES];



}
@end
